/*
 * Copyright © 2021 Dowsure
 * https://www.dowsure.com/
 *
 * All rights reserved.
 */

package com.dowsure.apisaas.enums;

/**
 * @description: 请求类型
 * @author: Dowsure
 **/
public enum MethodEnums {

    POST("POST", "POST"),
    GET("GET", "GET"),
    DELETE("DELETE", "DELETE"),
    UPDATE("UPDATE", "UPDATE")
    ;

    private String value;

    private String describe;

    MethodEnums(String value, String describe){
        this.value = value;
        this.describe = describe;
    }

    public String getValue() {
        return value;
    }

    @Override
    public String toString() {
        return String.valueOf(value);
    }

    public static MethodEnums fromValue(String text) {
        for (MethodEnums b : MethodEnums.values()) {
            if (String.valueOf(b.value).equals(text)) {
                return b;
            }
        }
        return null;
    }
}
